//
//  YFPlayer.h
//  CamerDemo
//
//  Created by Winny Zhang on 2019/3/30.
//  Copyright © 2019 Winny Zhang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface YFPlayer : UIView

/**
 播放视频的URL
 */
@property (nonatomic, strong) NSURL *videoURL;

/**
 展示视屏图层
 */
@property (nonatomic, strong) AVPlayerLayer *playerLayer;

/**
 初始化播放器

 @param frame 播放器 frame
 @param view 需要播放的View
 @param videoURL 视屏播放 URL
 @return 播放器
 */
- (instancetype)initWithFrame:(CGRect)frame onView:(UIView *)view videoURL:(NSURL *)videoURL;

/**
 停止播放
 */
- (void)stopPlaying;
@end

NS_ASSUME_NONNULL_END
